x86: Re-introduce VIDEO_CURRENT_MODE into video.S video-mode-setting
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Tue, 19 Jun 2007 14:09:59 +0000 (15:09 +0100)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Tue, 19 Jun 2007 14:09:59 +0000 (15:09 +0100)
code, and make visible at the command line via 'vga=current'.
Signed-off-by: Keir Fraser <keir@xensource.com>
docs/src/user.tex
xen/arch/x86/boot/cmdline.S
xen/arch/x86/boot/video.S
xen/arch/x86/boot/video.h
xen/drivers/video/vga.c

index 541d7e3b0cc15795b5759e7150f3664eb1b7ceca..2ccbf8b87c56d085df18e63c995759575b3813eb 100644 (file)
@@ -3178,6 +3178,7 @@ editing \path{grub.conf}.
   \begin{description}
   \item[ ask ] Display a vga menu allowing manual selection of video
   mode.
+  \item[ current ] Use existing vga mode without modification.
   \item[ text-$<$mode$>$ ] Select text-mode resolution, where mode is
   one of 80x25, 80x28, 80x30, 80x34, 80x43, 80x50, 80x60.
   \item[ gfx-$<$mode$>$ ] Select VESA graphics mode
index 34c183a268a7a094543e4c148e51c1572f078636..9dcce5e155ec43e25c1c26109232f8aac9c290c1 100644 (file)
@@ -297,7 +297,7 @@ cmdline_parse_early:
         call    .Lstr_prefix
         add     $8,%esp
         test    %eax,%eax
-        jnz     .Lcmdline_exit
+        jnz     .Lparse_vga_current
 
         /* We have 'vga=mode-<mode>'. */
         add     $5,%ebx
@@ -305,6 +305,19 @@ cmdline_parse_early:
         call    .Latoi
         add     $4,%esp
         mov     %ax,bootsym_phys(boot_vid_mode)
+        jmp     .Lcmdline_exit
+
+.Lparse_vga_current:
+        /* Check for 'vga=current'. */
+        push    %ebx
+        pushl   $sym_phys(.Lvga_current)
+        call    .Lstr_prefix
+        add     $8,%esp
+        test    %eax,%eax
+        jnz     .Lcmdline_exit
+
+        /* We have 'vga=current'. */
+        movw    $VIDEO_CURRENT_MODE,bootsym_phys(boot_vid_mode)
 
 .Lcmdline_exit:
         popa
@@ -328,6 +341,8 @@ cmdline_parse_early:
         .asciz  "gfx-"
 .Lvga_mode:
         .asciz  "mode-"
+.Lvga_current:
+        .asciz  "current"
 .Lno_rm_opt:
         .asciz  "no-real-mode"
 .Ledid_opt:
index d8b3fab5372390a3433cdc3b6725a1e9f60420c7..d62fa9e043bdde9071ac824ea351ef5c4ec7a05c 100644 (file)
@@ -530,6 +530,7 @@ spec_inits:
         .word   bootsym(set_8pixel)
         .word   bootsym(set_80x43)
         .word   bootsym(set_80x28)
+        .word   bootsym(set_current)
         .word   bootsym(set_80x30)
         .word   bootsym(set_80x34)
         .word   bootsym(set_80x60)
@@ -575,6 +576,7 @@ set14:  movw    $0x1111, %ax            # Use 9x14 font
         movb    $0x01, %ah              # Define cursor scan lines 11-12
         movw    $0x0b0c, %cx
         int     $0x10
+set_current:
         stc
         ret
 
index 08bc1e38ed4e29833870142e38535280144d79a2..40269541961b33219d50f20c69faf7c74b2422f4 100644 (file)
 #define VIDEO_80x50         0x0f01
 #define VIDEO_80x43         0x0f02
 #define VIDEO_80x28         0x0f03
-#define VIDEO_80x30         0x0f04
-#define VIDEO_80x34         0x0f05
-#define VIDEO_80x60         0x0f06
-#define VIDEO_LAST_SPECIAL  0x0f07
+#define VIDEO_CURRENT_MODE  0x0f04
+#define VIDEO_80x30         0x0f05
+#define VIDEO_80x34         0x0f06
+#define VIDEO_80x60         0x0f07
+#define VIDEO_LAST_SPECIAL  0x0f08
 
 #define ASK_VGA             0xfffd
 #define VIDEO_VESA_BY_SIZE  0xffff
index 1f6c2c504aa526873a29634c7bef99cc0d292fb5..7c9326e40cd88b07c994d255517c20fdb748f12c 100644 (file)
@@ -33,6 +33,9 @@ static unsigned char *video;
  *   'vga=ask':
  *      display a vga menu of available modes
  * 
+ *   'vga=current':
+ *      use the current vga mode without modification
+ * 
  *   'vga=text-80x<rows>':
  *      text mode, where <rows> is one of {25,28,30,34,43,50,60}
  *